#ifndef T1_REGS_H_
#define T1_REGS_H_

#define KUSEG_VIRTUAL_ADDR      0x00000000
#define KSEG0_VIRTUAL_ADDR      0x80000000
#define KSEG1_VIRTUAL_ADDR      0xA0000000

#define IO_BASE                 KSEG1_VIRTUAL_ADDR
#define MEM_BASE                KSEG0_VIRTUAL_ADDR

#define T1_IRAM_BASE            (MEM_BASE + 0)
#define T1_CS0_BASE             (MEM_BASE + 0x08000000)
#define T1_CS1_BASE             (MEM_BASE + 0x09000000)
#define T1_CS2_BASE             (MEM_BASE + 0x0A000000)
#define T1_CS3_BASE             (MEM_BASE + 0x0B000000)
#define T1_CS4_BASE             (MEM_BASE + 0x0C000000)
#define T1_EFLASH_BASE          (MEM_BASE + 0x10000000)

/********************* AHB Registers *********************/

#define T1_AHB_BASE             (IO_BASE + 0x18000000)
#define T1_DMAC_BASE            (T1_AHB_BASE + 0x00000)
#define T1_USB11_BASE           (T1_AHB_BASE + 0x10000)
#define T1_ENCRYPT_BASE         (T1_AHB_BASE + 0x20000)

/********************* APB0 Registers *********************/

#define T1_APB0_BASE            (IO_BASE + 0x19000000)
#define T1_UART0_BASE           (T1_APB0_BASE + 0x00000)
#define T1_UART1_BASE           (T1_APB0_BASE + 0x10000)
#define T1_UART2_BASE           (T1_APB0_BASE + 0x20000)
#define T1_UART3_BASE           (T1_APB0_BASE + 0x30000)
#define T1_ICTL_BASE            (T1_APB0_BASE + 0x50000)
#define T1_GPIO_BASE            (T1_APB0_BASE + 0x70000)
#define T1_TIMER_BASE           (T1_APB0_BASE + 0x80000)
#define T1_WDT_BASE             (T1_APB0_BASE + 0x90000)
#define T1_PWM_BASE             (T1_APB0_BASE + 0xA0000)
#define T1_DAC_BASE             (T1_APB0_BASE + 0xB0000)
#define T1_SYS_BASE             (T1_APB0_BASE + 0xD0000)

/********************* APB1 Registers *********************/

#define T1_APB1_BASE            (IO_BASE + 0x1A000000)
#define T1_NVRAM_BASE           (T1_APB1_BASE + 0x00000)
#define T1_NVRAM_VBASE          (MEM_BASE + 0x1A000000)
#define T1_DEF_BASE             (T1_NVRAM_BASE + 0x1000)
#define T1_RTC_BASE             (T1_APB1_BASE + 0x10000)
#define T1_78160_BASE           (T1_APB1_BASE + 0x20000)
#define T1_78161_BASE           (T1_APB1_BASE + 0x30000)
#define T1_78162_BASE           (T1_APB1_BASE + 0x40000)
#define T1_MAGCARD_BASE         (T1_APB1_BASE + 0x50000)
#define T1_FSKDTMF_BASE         (T1_APB1_BASE + 0x60000)
#define T1_SPI0_BASE            (T1_APB1_BASE + 0x80000)
#define T1_SPI1_BASE            (T1_APB1_BASE + 0x90000)

#endif /* T1_REGS_H_ */
